<form action="<?php e_page("site","addSubmit")?>" method="post"  enctype="multipart/form-data">
    <fieldset>
        <legend></legend>
        <label for="nameInput">站点名称</label>
        <input type="text" name="name" id="nameInput" placeholder="请输入站点名称"/><br/>
        <label for="map_addressInput">站点地址</label>
        <input type="text" name="map_address" id="map_addressInput" placeholder="请输入站点地址"/><br/>
    </fieldset>
    <fieldset>
        <legend>地图选择(拖拽地图地图中的标志设置)</legend>
        <label for="longitudeInput">站点经度</label>
        <input type="text" name="longitude" id="longitudeInput" readonly placeholder="拖拽地图地图中的标志设置经度"/>
        <br/>
        <label for="latitudeInput">站点纬度</label>
        <input type="text" name="latitude" id="latitudeInput"  readonly placeholder="拖拽地图地图中的标志设置纬度"/>
        <br/>
        <div id="allmap" style="margin-left:15px;width:600px;height:320px;"></div>
    </fieldset>
    <fieldset>
        <legend></legend>
        <label for="usernameInput">手机号</label>
        <input type="text" name="username" id="usernameInput" placeholder="请输入手机号（可作为登录名）"/><br/>
        <label for="emailInput">邮箱</label>
        <input type="text" name="email" id="emailInput" placeholder="请输入邮箱（可作为登录名）"/><br/>
        <label for="passwordInput">密码</label>
        <input type="password" name="password" id="passwordInput" placeholder="请输入登陆后台密码"/><br/>
    </fieldset>
    <input type="submit" value="添加"/>
</form>
<script src="plugin/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
    _root = "<?php echo $system['siteRoot'];?>";
</script>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript" src="script/simpleAddress.js"></script>
<script type="text/javascript">
    $(function(){
        var select = $(".js-select-address-box").hide();
        var input  = $("#service_address").show();
        var button = $(".update-address").show();
        button.click(function(e){
            e.preventDefault()
            select.show();
            input.hide();
            button.hide()
            $('#address_id').remove();
        })
    })
</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=HNtF8PpKdoLMQTDurEuZUVTE"></script>
<script type="text/javascript">
    var map = new BMap.Map("allmap");
    map.addControl(new BMap.NavigationControl());
    map.enableScrollWheelZoom();    //启用滚轮放大缩小
    map.enableContinuousZoom();    //启用地图惯性拖拽
    //map.setZoom(10);
    var longitude=Number($("[name=longitude]").val()) || 117.565297;
    if(longitude>120|| longitude<115) longitude=117.565297;
    var latitude=Number($("[name=latitude]").val()) || 33.547786;
    if(latitude>35|| latitude<30) latitude=33.547786;
    var point = new BMap.Point(longitude,latitude);
    map.centerAndZoom(point,13);
    var marker = new BMap.Marker(point);
    map.addOverlay(marker);
    marker.enableDragging();
    marker.addEventListener("dragend", function(e){
        var p = e.point;
        $("[name=latitude]").val(p.lat);
        $("[name=longitude]").val(p.lng);
    });
</script>